  public   class GraphType {
    final static int POPULARITY=0;
    final static int LENGTH=1;
    
    private int selected;
    
    public GraphType(int type)
    {
      selected=type;
    }
    
    public int getType()
    {
      return selected;
    }
    
    public void setType(int type)
    {
      selected=type;
    }
    
    public void setPopularity()
    {
      selected=POPULARITY;
    }
        public void setLength()
    {
      selected=LENGTH;
    }
      public boolean isPopularity()
    {
      return  selected==POPULARITY;
    }
        public boolean isLength()
    {
      return selected==LENGTH;
    }
    
    @Override public String toString()
    {
      if(selected==POPULARITY)
        return "Popularity";
      if(selected==LENGTH)
        return "Length";
        return "Unknown value";
    }
    
    
    @Override public boolean equals(Object other) {
        boolean result = false;
        if (other instanceof GraphType) {
            GraphType that = (GraphType) other;
            result = (this.getType() == that.getType());
        }
        return result;
    }
}
